package org.facyt.vacas.util;

import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Map;

public class Constantes {
	
	public static Map<Long, Double> hash = new HashMap();
	public static int presicion = 3;
	public static int presicioncosto = 2;
	public static RoundingMode redondeomode = RoundingMode.HALF_UP;
	
	/**
	 * constantes de la Grilla de Recuento.
	 */
	public class EncabezadosRecontar
	{
		public static final String DESCRIPCION_MP = "descripcion_mp";
		public static final String COSTO = "costo";	
		public static final String UNIDAD = "unidad";	
		public static final String CANTIDAD = "cantidad";
		public static final String CODIGO_MP = "codigo";
		public static final String MASDE = "masde";
		public static final String MENOSDE = "menosde";
		public static final String IGUALA = "iguala";
		public static final String ANIMALSELECCIONADO = "animal";
		public static final int IGUALA_INT = 1;
		public static final int MASDE_INT = 2;
		public static final int MENOSDE_INT = 3;
	    public static final String CANTIDAD_A_PROCESAR = "cantidad_a_elaborar";
		public static final String ENERGIA = "energia";
		
	}

	
	
	public Constantes() {
		super();
		this.has();
		// TODO Auto-generated constructor stub
	}
	
	public class TipoException{
		public static final String CONFIRMACION = "Confirmacion";
		public static final String INFORMACION = "Informacion";
		public static final String ERROR = "Error";
		public static final String ADVERTENCIA = "Advertencia";
	}
	
	public static class PathArchivos
	{
		public static final String FILEINSIMPLEX = "archivoSimpl.txt";
		public static final String FILELOG = "log.txt";
		public static final String SALIDA = "salida.txt";
		public static final String SALIDA1 = "salida1.txt";
		public static final String SALIDA2 = "salida2.txt";
		public static final String SALIDA3 = "salida3.txt";
		
		public static final String COSMINDUALEXE = "cosminDual.exe";
		public static final String COSMINEXE = "copiaFuente2.exe";
		
		//TODO: agregar que lea los archivosa del cliente, osea, etemporal crear una carpeta para el cliente
		//hacer que lea la localizacion desde un porperties
		public static String getDirectorioTemporal(){
		return "c://TEMP//";
		//return "D://temporal//";
		}
	}


	private void has() {
		hash.put(new Long(1), new Double(66.3));
		hash.put(new Long(2), new Double(1));
		hash.put(new Long(3), new Double(3.16));
		hash.put(new Long(4), new Double(33.1));
		hash.put(new Long(5), new Double(23.9));
		hash.put(new Long(6), new Double(5.4));
		hash.put(new Long(7), new Double(26.5));
		hash.put(new Long(8), new Double(3.8));
		hash.put(new Long(9), new Double(1.1));
		hash.put(new Long(10), new Double(31.1));
		hash.put(new Long(11), new Double(61.6));
		hash.put(new Long(12), new Double(7.3));
		hash.put(new Long(13), new Double(12.3));
		hash.put(new Long(14), new Double(75));
		hash.put(new Long(15), new Double(3.7));
		hash.put(new Long(16), new Double(10));
		hash.put(new Long(17), new Double(1.31));
		hash.put(new Long(18), new Double(0.3));
		hash.put(new Long(19), new Double(0.37));
		hash.put(new Long(20), new Double(0.64));
		hash.put(new Long(21), new Double(0.28));
		hash.put(new Long(22), new Double(0.16));
		hash.put(new Long(23), new Double(3.21));
		hash.put(new Long(24), new Double(0.9));
		hash.put(new Long(25), new Double(0.01));
		hash.put(new Long(26), new Double(0.9));
		hash.put(new Long(27), new Double(0.6));
		hash.put(new Long(28), new Double(0.9));
		hash.put(new Long(29), new Double(0.31));
		hash.put(new Long(30), new Double(1));
		hash.put(new Long(31), new Double(0.44));
		hash.put(new Long(32), new Double(1));
		hash.put(new Long(33), new Double(10));
		hash.put(new Long(34), new Double(0.04));
		hash.put(new Long(35), new Double(0));
		hash.put(new Long(36), new Double(0.85));
		hash.put(new Long(37), new Double(215));
		hash.put(new Long(38), new Double(0.1));
		hash.put(new Long(39), new Double(54));
		hash.put(new Long(40), new Double(0.01));
		hash.put(new Long(41), new Double(0.2));
		hash.put(new Long(42), new Double(1));
		hash.put(new Long(43), new Double(33));
		hash.put(new Long(44), new Double(0.15));
		hash.put(new Long(45), new Double(5.18));
		hash.put(new Long(46), new Double(1.58));
		hash.put(new Long(47), new Double(4.44));
		hash.put(new Long(48), new Double(0));
		hash.put(new Long(49), new Double(0));
		hash.put(new Long(50), new Double(0));
		hash.put(new Long(51), new Double(0.98));
		hash.put(new Long(52), new Double(0));
		hash.put(new Long(53), new Double(0));
		hash.put(new Long(54), new Double(0));


	}
	

	/*
	 * Constantes para el log
	 */
	public final  static String LOG_ERROR = "============= ERROR ====================";
	public final  static String LOG_INFO = "============= INFO ====================";
	public static final long IDGRUPOFACYT = 1;
	
	public static class TipoEnergia {

		public static final long CONCENTRADOS_ID = 3;
		public static final long FORRAJES = 4;
		
	/*	1;"Acido graso"
		2;"Animal"
		3;"Concentrado"
		4;"Forraje"
		5;"Grasa"
		6;"Ternero"
		7;"Vit-Mineral"
		8;"Sin energía"*/

		
	}
	
	public static class componente{
		
		//TODO pc o PC_C?
		public static final Integer PC = 7;
		public static final Integer PC_a = 10;
		public static final Integer PC_b = 11;
		public static final Integer Kd = 13;	

		public static final Integer TDN = 1;
		public static final Integer ED = 3;
		public static final Integer EE = 15;
		public static final Integer FDN = 4;
	//	public static final Integer lc4 = ;
	
		
		/** id de los componentes en la base de datos
		 * select 'public static final long '|| descripcion ||' = '||id|| ';' from vacas.componente
*/
public static final Integer PAF = 2;

public static final Integer FDA = 5;
public static final Integer Lign = 6;

public static final Integer N_FDN = 8;
public static final Integer NIDA = 9;

public static final Integer PC_c = 12;
public static final Integer RUP_Digest = 14;

public static final Integer CEN = 16;
public static final Integer Ca = 17;
public static final Integer Ca_Bio = 18;
public static final Integer P0p_dm = 19;
public static final Integer P_Bio = 20;
public static final Integer Mg0mg_dm = 21;
public static final Integer Mg_Bio = 22;
public static final Integer K0k_dm = 23;
public static final Integer K_Bio = 24;
public static final Integer Na = 25;
public static final Integer Na_Bio = 26;
public static final Integer Cl = 27;
public static final Integer Cl_Bio = 28;
public static final Integer S = 29;
public static final Integer S_Bio = 30;
public static final Integer Co = 31;
public static final Integer Co_Bio = 32;
public static final Integer Cu = 33;
public static final Integer Cu_Bio = 34;
public static final Integer I = 35;
public static final Integer I_Bio = 36;
public static final Integer Fe = 37;
public static final Integer Fe_Bio = 38;
public static final Integer Mn = 39;
public static final Integer Mn_Bio = 40;
public static final Integer Se = 41;
public static final Integer Se_Bio = 42;
public static final Integer Zn = 43;
public static final Integer Zn_Bio = 44;
public static final Integer Lisina = 45;
public static final Integer Metionina = 46;
public static final Integer Treonina = 47;
public static final Integer Vit_A = 48;
public static final Integer Vit_D = 49;
public static final Integer Vit_E = 50;
public static final Integer NFC_Digest = 51;
public static final Integer DigPB = 52;
public static final Integer DigFDN = 53;
public static final Integer DigEE = 54;
/*public static final Integer tdFDN = 55;
public static final Integer tdPB = 56;*/

//55;"CMS"
		///////56;"EM"
		//57;"ENL"
		//58;"PDR"
		//59;"PM"
		//60;"FDN"
public static final Integer CMS = 55;
public static final Integer EM = 56;
public static final Integer ENL = 57;
public static final Integer PDR = 58;
public static final Integer PM = 59;
public static final Integer CALCIO = 61;
public static final Integer FOSFORO = 62;
public static final Integer MAGNESIO = 63;
public static final Integer FDN_Forraje = 64;


	}
		
		/**
		 * cantidad del componente para la mp id= 125
		 * select 'public static final long '|| descripcion ||' = '||m.cantidad|| ';'
from vacas.composicion_mp m, vacas.componente c where m.fk_materia_prima = 125
and c.id = m.fk_componente
		 * @author Usuario
		 *
		 */
		//TODO los guiones - se reemplazaron por guion bajo _
		//las / la reemplazamos por un cero 0
		//el espacio antes de digest lo reemplazamos por _
		
		public static class cantidad_componente{
			
			public static final double TDN = 66.3;
			public static final double PAF = 1;
			public static final double ED = 3.16;
			public static final double FDN = 33.1;
			public static final double FDA = 23.9;
			public static final double Lign = 5.4;
			public static final double PC = 26.5;
			public static final double N_FDN = 3.8;
			public static final double NIDA = 1.1;
			public static final double PC_a = 31.1;
			public static final double PC_b = 61.6;
			public static final double PC_c = 7.3;
			public static final double Kd = 12.3;
			public static final double RUP_Digest = 75;
			public static final double EE = 3.7;
			public static final double CEN = 10;
			public static final double Ca = 1.31;
			public static final double Ca_Bio = 0.3;
			public static final double P0p_dm = 0.37;
			public static final double P_Bio = 0.64;
			public static final double Mg0mg_dm = 0.28;
			public static final double Mg_Bio = 0.16;
			public static final double K0k_dm = 3.21;
			public static final double K_Bio = 0.9;
			public static final double Na = 0.01;
			public static final double Na_Bio = 0.9;
			public static final double Cl = 0.6;
			public static final double Cl_Bio = 0.9;
			public static final double S = 0.31;
			public static final double S_Bio = 1;
			public static final double Co = 0.44;
			public static final double Co_Bio = 1;
			public static final double Cu = 10;
			public static final double Cu_Bio = 0.04;
			public static final double I = 0;
			public static final double I_Bio = 0.85;
			public static final double Fe = 215;
			public static final double Fe_Bio = 0.1;
			public static final double Mn = 54;
			public static final double Mn_Bio = 0.01;
			public static final double Se = 0.2;
			public static final double Se_Bio = 1;
			public static final double Zn = 33;
			public static final double Zn_Bio = 0.15;
			public static final double Lisina = 5.18;
			public static final double Metionina = 1.58;
			public static final double Treonina = 4.44;
			public static final double Vit_A = 0;
			public static final double Vit_D = 0;
			public static final double Vit_E = 0;
			public static final double NFC_Digest = 0.98;
			public static final double DigPB = 0;
			public static final double DigFDN = 0;
			public static final double DigEE = 0;

		}
		

		public static double getCantidad(long id) {
			
			return hash.get(new Long(id)).doubleValue();
		}
	
		

}
